﻿
namespace CsvSegítő
{
    using System;
    public class CsvParserOptions
    {
        public readonly char[] FieldsSeparator;

        public readonly bool SkipHeader;

        public readonly int DegreeOfParallelism;

        public readonly bool KeepOrder;

        public CsvParserOptions(bool skipHeader, char[] fieldsSeparator)
            : this(skipHeader, fieldsSeparator, Environment.ProcessorCount, true)
        {
        }

        public CsvParserOptions(bool skipHeader, char[] fieldsSeparator, int degreeOfParallelism, bool keepOrder)
        {
            SkipHeader = skipHeader;
            FieldsSeparator = fieldsSeparator;
            DegreeOfParallelism = degreeOfParallelism;
            KeepOrder = keepOrder;
        }

        public override string ToString()
        {
            return
                $"CsvParserOptions (FieldsSeparator = ({string.Join(", ", FieldsSeparator)}), SkipHeader = {SkipHeader})";
        }
    }
}